<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 权重1+100+1 = 102 */
        div#demo p{
            color: red;
        }

        /* 权重100 */
        #box{
            color: green;
        }
        
        /* 权重 无穷大+10 */
        .item{
            color: blue !important;
        }

        /* 权重 无穷大+10 */
        .item{
            color: pink !important;
        }

        /* 同样权重的样式，写在后面的会覆盖前面的 */
    </style>
</head>
<body>
    <div id="demo">
        <p id="box" class="item">DEMO内部的P标签</p>
    </div>
    <div>
        <p>普通的P标签</p>
    </div>
</body>
</html>